package com.veng.springbootdemo.rabbit;

import com.veng.springbootdemo.po.User;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class FanoutRabbitSender {

    @Autowired
    private RabbitTemplate rabbitTemplate;

    public void send(){
        User user = new User();
        user.setUserName("veng");
        rabbitTemplate.convertAndSend("fanoutExchange",null,user);
    }
}
